<template>
	<view class="ReviewDetails" :class="{'pof':adminShow}">
		<view class="review f-background margin-bottom-24 radius20" v-if="adminInfo.applyStatus == 2">
			<text class="color size-32">拒绝原因：{{adminInfo.remarks}}</text>
		</view>
		<view class="infos-for f-background margin-bottom-24 radius20">
			<Authentication :item="adminInfo" @previewImage="onPreviewImage($event)" />
		</view>
		<!-- 服务小区 -->
		<view class="authentication f-background radius20 margin-bottom-24">
			<view class="auth-title font-weight-600 color0 size-32">服务小区</view>
			<view v-for="(item,index) in adminInfo.infos" :key="index">
				<view class="auth-border border-top" v-if="index != 0"></view>
				<ServingCell :item="item" @previewImage="onPreviewImage($event)" />
			</view>
		</view>
		<!-- 认证信息 -->
		<view class="authentication f-background radius20">
			<view class="font-weight-600 color0 size-32">认证信息</view>
			<view class="authent f5-background" @click="onPreviewImage(adminInfo.carFore)">
				<image class="width-height100" :src="adminInfo.carFore" mode=""></image>
			</view>
			<view class="authent f5-background" @click="onPreviewImage(adminInfo.carBack)">
				<image class="width-height100" :src="adminInfo.carBack" mode=""></image>
			</view>
		</view>
		<view class="add-goods app-bottom-left f-background inset-bottom dis" v-if="adminInfo.applyStatus == 0">
			<view class="bottom width100">
				<AuditOperation @agree="postGetInfoById(true)" :auditId="adminInfo.id" />
			</view>
		</view>
		<view class="inset-bottom"></view>
		<view class="details" v-if="adminInfo.applyStatus == 0"></view>
	</view>
</template>

<script>
	import Authentication from "@/components/authentication/authentication"
	import AuditOperation from "@/components/audit-operation/audit-operation"
	import ServingCell from "@/components/serving-cell/serving-cell"
	import { GetInfoById } from "@/api/index"
	export default {
		components: { Authentication, ServingCell, AuditOperation },
		data() {
			return {
				disabled: false,
				adminInfo: {},
				id: 0,
			}
		},
		onLoad(options) {
			this.id = options.id
			this.postGetInfoById()
		},
		methods: {
			// 查看详情
			async postGetInfoById(bool) {
				const { code, data } = await GetInfoById({ id: this.id })
				if (code == '200') {
					this.adminInfo = { ...data, ...{ bool: true } }
					if (bool) uni.$u.toast('操作成功', 2000)
				}
			},
			// 查看大图
			onPreviewImage(item) {
				console.log(item)
				uni.previewImage({
					current: 0,
					urls: [item]
				});
			},
		}
	}
</script>

<style lang="scss">
	.ReviewDetails {
		padding: 20rpx 24rpx;

		.add-goods {
			position: fixed;
			width: 100%;
			height: 162rpx;

			.bottom {
				padding: 0 44rpx;
			}
		}

		.details {
			padding-top: 162rpx;
		}

		.review {
			padding: 26rpx 20rpx;
		}

		.authentication {
			padding: 32rpx 24rpx 26rpx;

			.auth-title {
				margin-bottom: 28rpx;
			}

			.auth-border {
				margin: 30rpx 0;
			}

			.authent {
				width: 662rpx;
				height: 424.73rpx;
				border-radius: 32rpx;
				overflow: hidden;
				margin: 40rpx auto;
			}
		}
	}
</style>